editable: Fix a thinko
authorMatthias Clasen <mclasen@redhat.com>
Sun, 17 Mar 2019 22:44:36 +0000 (18:44 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 17 Mar 2019 22:46:18 +0000 (18:46 -0400)
When dealing with subclasses of GtkEntry, we were not
getting the property offset that is stored on the GtkEntry
type.

This was showing up as criticals when trying to set
::width-chars on a GtkFileChooserEntry.

gtk/gtkeditable.c

index f710d51cc0b29aaf548cd4edaa682db97e73e2fd..9569c4bc20e8c080dbb5c2493b87b937a697f74f 100644 (file)
@@ -935,7 +935,10 @@ gtk_editable_delegate_set_property (GObject      *object,
   GType type = G_TYPE_FROM_INSTANCE (object);
   guint first_prop;
 
-  first_prop = GPOINTER_TO_UINT (g_type_get_qdata (type, quark_editable_data));
+  do {
+    first_prop = GPOINTER_TO_UINT (g_type_get_qdata (type, quark_editable_data));
+    type = g_type_parent (type);
+  } while (first_prop == 0 && type != 0);
 
   if (prop_id < first_prop)
     return FALSE;
@@ -994,7 +997,10 @@ gtk_editable_delegate_get_property (GObject    *object,
   GType type = G_TYPE_FROM_INSTANCE (object);
   guint first_prop;
 
-  first_prop = GPOINTER_TO_UINT (g_type_get_qdata (type, quark_editable_data));
+  do {
+    first_prop = GPOINTER_TO_UINT (g_type_get_qdata (type, quark_editable_data));
+    type = g_type_parent (type);
+  } while (first_prop == 0 && type != 0);
 
   if (prop_id < first_prop)
     return FALSE;